package com.base.commonlib.http;


import com.base.commonlib.http.builder.GetDownLoadBuilder;
import com.base.commonlib.http.builder.GetQueryBuilder;
import com.base.commonlib.http.builder.PostContentBuilder;
import com.base.commonlib.http.builder.PostFileBuilder;
import com.base.commonlib.http.builder.PostFormBuilder;
import com.base.commonlib.http.builder.PostPicsBuilder;
import com.base.commonlib.http.builder.PutContentBuilder;
import com.base.commonlib.sp.SpUtil;

/**
 * Date：2019/4/15 上午11:27
 * Creator：arvin
 * Des： n
 */
public class RealNetWorkUtil {
    private static final String BASE_URL = "http://121.229.3.115:8989/"; //222.92.22.82   老ip//221.224.15.179
    private static final String DEBUG_URL="http://192.168.1.19:8989/";
    public static final String HOST_IP = "http://121.229.3.115";
//    private static final String DEBUG_URL="http://zhongyue.in.3322.org//";

    private static boolean isDebug = false;

    public static String getBaseUrl(){
        if (isDebug){
            return DEBUG_URL;
        }else {
            return BASE_URL;
        }
    }
    public static final String TYPE = "0";//0 吴中城管 1 。昆山城管




   //public static final String PDF_TEST_URL = "http://180.97.72.51:2090/XZZF/WritPDF/2019/ca8e63e5-bc12-4be8-ac84-5fcf405ce18c/c2875fab-9be7-4a9a-9341-e8441da84d5e.pdf";

    public static GetDownLoadBuilder downLoad() {
        return new GetDownLoadBuilder().baseUrl(getBaseUrl())
                .addHeaders("token", SpUtil.getToken())
                .addHeaders("User-Agent", "ANDROID");
    }

    public static GetQueryBuilder get()
    {
        return new GetQueryBuilder().baseUrl(getBaseUrl())
                .addHeaders("token",SpUtil.getToken())
                .addHeaders("User-Agent","ANDROID");
    }

    public static PostContentBuilder postContent() {
        return new PostContentBuilder().baseUrl(getBaseUrl())
                .addHeaders("token",SpUtil.getToken())
                .addHeaders("User-Agent","ANDROID")
                .addHeaders("Content-Type","application/json");
    }

    public static PostFormBuilder postForm() {
        return new PostFormBuilder().baseUrl(getBaseUrl())
                .addHeaders("token",SpUtil.getToken())
                .addHeaders("User-Agent","ANDROID");
    }
    public static PutContentBuilder putContent() {
        return new PutContentBuilder().baseUrl(getBaseUrl())
                .addHeaders("token",SpUtil.getToken())
                .addHeaders("User-Agent","ANDROID")
                .addHeaders("Content-Type","application/json");
    }

    public static PostFileBuilder postFile() {
        return new PostFileBuilder().baseUrl(getBaseUrl())
                .addHeaders("token",SpUtil.getToken())
                .addHeaders("User-Agent","ANDROID");
    }

    public static PostPicsBuilder postPics() {
        return new PostPicsBuilder().baseUrl(getBaseUrl())
                .addHeaders("token",SpUtil.getToken())
                .addHeaders("User-Agent","ANDROID");
    }
    public static PostContentBuilder postContentForCard() {
        return new PostContentBuilder().baseUrl("http://gsocr.jiketravel.com/")
                .addHeaders("Postman-Token","d866235b-a7e1-4e05-af73-80855b19725e")
                .addHeaders("cache-control","no-cache")
                .addHeaders("Content-Type","application/json");
    }
}
